﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using GWEB.WebBase.Entity;
using GWEB.WebBase.Utility;
using GWEB.WebFrame.Public;

namespace GWEB.WebFrame.Models
{
    public class Create
    {
        public PageInfo Init()
        {
            PageInfo pg = new PageInfo();
            HttpSessionState session =System.Web.HttpContext.Current.Session;
            pg.dict = BasePage.getDict(session);
            pg.Type = "Create";
            pg.SMenuId = "KH";
            pg.TableName = "cu_Customers";
            pg.KeyFieldName = "id";
            pg.Sop = BasePage.Grant(session, pg.SMenuId);
            ColumnInfo cl;
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "custName"; cl.HeadText = "宝宝姓名"; cl.IsCheck = true; cl.Length = 20; cl.IsNull = false; cl.ErrMessage = cl.HeadText+":必填且长度不能超过"+cl.Length; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "custTel"; cl.HeadText = "联系电话"; cl.IsCheck = true; cl.Length = 11; cl.IsNull = false; cl.ErrMessage = cl.HeadText + ":必填且长度为11位";cl.IsUnique = true; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Date; cl.FieldName = "birdDate"; cl.HeadText = "出生日期"; cl.IsCheck = true;  cl.ErrMessage = cl.HeadText + ":格式有错误,示例:" + Date.nowString(); pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "childName"; cl.HeadText = "宝宝小名";cl.IsCheck = true; cl.Length = 30; cl.ErrMessage = cl.HeadText + ":长度不能超过" + cl.Length; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "linkName"; cl.HeadText = "家长姓名"; cl.IsCheck = true; cl.Length = 20; cl.ErrMessage = cl.HeadText + ":长度不能超过" + cl.Length; pg.AddColumn(cl);

            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "linkRelation"; cl.HeadText = "关系"; cl.IsCondition = true; cl.DictTypeID = "D04"; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "custFromId"; cl.HeadText = "渠道来源"; cl.IsCondition = true; cl.DictTypeID = "D03"; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "custFromRemark"; cl.HeadText = "来源备注"; cl.IsCheck = true; cl.Length = 50; cl.ErrMessage = cl.HeadText + ":长度不能超过" + cl.Length; pg.AddColumn(cl);
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "custRemark"; cl.HeadText = "备注"; cl.IsCheck = true; cl.Length = 200; cl.ErrMessage = cl.HeadText + ":长度不能超过" + cl.Length; pg.AddColumn(cl);
            


            return pg;
        }
    }
}